home *** CD-ROM | disk | FTP | other *** search
Text File | 1993-01-27 | 1.5 KB | 58 lines | [TEXT/KAHL] |
- Ok, well no actually, I didnt know, but I thought I stood
- a fair chance. Pulled out my handy dandy IM 6 and started
- plugging away. I wrote the replace Getsalt fcn as
-
- pascal OSErr main(selector, response)
- OSType selector;
- long *response;
- {
- *response = 0x12; /* return a value that will disable superclock */
- return 0;
- }
-
- and set its atrribs as locked and SysHeap.
-
- Then I did my code to use it in ARASHI
-
- ProcPtr oldGestaltFunction;
-
- typedef pascal OSType (*PFunc)(long);
-
- /* DisableSuperclock will set the Gestalt selector 'savr' to indicate that a */
- /* screen saver, such as afterdark, is enabled already, thus superclock will */
- /* not attempt to draw on the playing surface. */
- void DisableSuperClock()
- {
- OSErr myNewErr, myReplaceErr;
- int gstFuncRsrcID = 128;
- Handle gstFuncHandle;
- int SAVRTrouble = 130;
-
- gstFuncHandle = GetResource('GDEF', gstFuncRsrcID);
- if(gstFuncHandle == 0)
- Alert(SAVRTrouble,0);
- else
- {
- DetachResource(gstFuncHandle);
- myNewErr = NewGestalt('SAVR',(ProcPtr)(*gstFuncHandle));
- if(myNewErr != noErr)
- {
- myReplaceErr = ReplaceGestalt('SAVR',
- (PFunc)(*gstFuncHandle),(ProcPtr)oldGestaltFunction);
- if(myReplaceErr != noErr)
- Alert(SAVRTrouble,0);
- }
- }
- DisposeHandle(gstFuncHandle);
- }
-
-
- but it crashes every time just after returning from DisableSuperClock.
- Superclock does turn off though...
- I have checked with MacsBug and theGDEF rsrc does seem to be at
- *gstFuncHandle. I have tried with the PFunc pointer and just
- the ProcPtr.
-
- Any ideas? I feel I must simply be overlooking something simple.
-
-